package com.ruoyi.backend.service.impl;

import com.ruoyi.backend.domain.ShopBidding;
import com.ruoyi.backend.mapper.ShopBiddingMapper;
import com.ruoyi.backend.service.IShopBiddingService;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 店铺竞标Service业务层处理
 * 
 * @author wjr
 * @date 2025-09-23
 */
@Service
public class ShopBiddingServiceImpl implements IShopBiddingService 
{
    @Autowired
    private ShopBiddingMapper shopBiddingMapper;

    /**
     * 查询店铺竞标
     * 
     * @param id 店铺竞标主键
     * @return 店铺竞标
     */
    @Override
    public ShopBidding selectShopBiddingById(Integer id)
    {
        return shopBiddingMapper.selectShopBiddingById(id);
    }

    /**
     * 查询店铺竞标列表
     * 
     * @param shopBidding 店铺竞标
     * @return 店铺竞标
     */
    @Override
    public List<ShopBidding> selectShopBiddingList(ShopBidding shopBidding)
    {
        return shopBiddingMapper.selectShopBiddingList(shopBidding);
    }

    /**
     * 新增店铺竞标
     * 
     * @param shopBidding 店铺竞标
     * @return 结果
     */
    @Override
    public int insertShopBidding(ShopBidding shopBidding)
    {
        shopBidding.setCreateBy(SecurityUtils.getUsername());
        shopBidding.setCreateTime(DateUtils.getNowDate());
        return shopBiddingMapper.insertShopBidding(shopBidding);
    }

    /**
     * 修改店铺竞标
     * 
     * @param shopBidding 店铺竞标
     * @return 结果
     */
    @Override
    public int updateShopBidding(ShopBidding shopBidding)
    {
        shopBidding.setUpdateBy(SecurityUtils.getUsername());
        shopBidding.setUpdateTime(DateUtils.getNowDate());
        return shopBiddingMapper.updateShopBidding(shopBidding);
    }

    /**
     * 批量删除店铺竞标
     * 
     * @param ids 需要删除的店铺竞标主键
     * @return 结果
     */
    @Override
    public int deleteShopBiddingByIds(Integer[] ids)
    {
        return shopBiddingMapper.deleteShopBiddingByIds(ids);
    }

    /**
     * 删除店铺竞标信息
     * 
     * @param id 店铺竞标主键
     * @return 结果
     */
    @Override
    public int deleteShopBiddingById(Integer id)
    {
        return shopBiddingMapper.deleteShopBiddingById(id);
    }
}
